package hz.mobileproject.pda.listener;

import android.widget.SeekBar;

/**
 * Created by Lc on 2017/12/28.
 */

public abstract class OnSeekBarChangedListener implements SeekBar.OnSeekBarChangeListener {
    private int state = 0;
    public static final int DOWN = 1;
    public static final int UP = 0;

    @Override
    public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) {
        progressChanged(seekBar,progress,fromUser);
    }

    @Override
    public void onStartTrackingTouch(SeekBar seekBar) {
        state = 1;
        startTrackingTouch(seekBar);
    }

    @Override
    public void onStopTrackingTouch(SeekBar seekBar) {
        state = 0;
        stopTrackingTouch(seekBar);
    }

    public int getState(){
        return state;
    }

    public abstract void progressChanged(SeekBar seekBar, int progress, boolean fromUser);
    public abstract void startTrackingTouch(SeekBar seekBar);
    public abstract void stopTrackingTouch(SeekBar seekBar);
}
